package com.servlet;

import com.entity.Tag;
import com.utils.JsonUtil;


import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.*;
import java.io.IOException;

@WebServlet(name = "TagServlet", value = "/TagServlet")
public class TagServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        JsonUtil jsonUtil = new JsonUtil();
        Tag tag = new Tag();
        tag.setTag_name("456");
        tag.setTag_id(1);
        String s = jsonUtil.JavaToJson(tag);
        response.getWriter().print(s);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        doPost(request,response);
    }
}
